/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package br.com.menosehmais.framework.persistence;

import br.com.menosehmais.model.UsuarioDO;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import org.hibernate.annotations.*;
import org.joda.time.LocalDateTime;


/**
 *
 * @author Junior JAFJ
 */
@MappedSuperclass
public abstract class OpinionDO<DO extends DomainObject> extends DomainObject implements IHaveAccount, IHaveCreationDateTime, IHaveLastUpdate {

    private String referenceId;

    @ManyToOne
    private UsuarioDO usuario;

    @Column(updatable = false)
    @Type(type = "org.joda.time.contrib.hibernate.PersistentLocalDateTime")
    private LocalDateTime creationDateTime;

    @Type(type = "org.joda.time.contrib.hibernate.PersistentLocalDateTime")
    private LocalDateTime lastUpdate;

    @NotNull
    private Boolean pleasure;

    @Override
    public LocalDateTime getCreationDateTime() {
        return creationDateTime;
    }

    @Override
    public void setCreationDateTime(LocalDateTime creationDateTime) {
        this.creationDateTime = creationDateTime;
    }

    @Override
    public LocalDateTime getLastUpdate() {
        return lastUpdate;
    }

    @Override
    public void setLastUpdate(LocalDateTime lastUpdate) {
        this.lastUpdate = lastUpdate;
    }

    public String getReferenceId() {
        return referenceId;
    }

    public void setReferenceId(String referenceId) {
        this.referenceId = referenceId;
    }

    public UsuarioDO getUsuario() {
        return usuario;
    }

    public void setUsuario(UsuarioDO usuario) {
        this.usuario = usuario;
    }
 
    /**
     * @return the pleasure
     */
    public Boolean getPleasure() {
        return pleasure;
    }

    /**
     * @param pleasure the pleasure to set
     */
    public void setPleasure(Boolean pleasure) {
        this.pleasure = pleasure;
    }

}
